Optimal. Leaf size=97 \[ \frac{c^2 (A+3 i B)}{a^2 f (-\tan (e+f x)+i)}-\frac{c^2 (-B+i A)}{a^2 f (-\tan (e+f x)+i)^2}-\frac{B c^2 \log (\cos (e+f x))}{a^2 f}+\frac{i B c^2 x}{a^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.151759, antiderivative size = 97, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 41, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.049, Rules used = {3588, 77} \[ \frac{c^2 (A+3 i B)}{a^2 f (-\tan (e+f x)+i)}-\frac{c^2 (-B+i A)}{a^2 f (-\tan (e+f x)+i)^2}-\frac{B c^2 \log (\cos (e+f x))}{a^2 f}+\frac{i B c^2 x}{a^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3588
Rule 77
Rubi steps
\begin{align*} \int \frac{(A+B \tan (e+f x)) (c-i c \tan (e+f x))^2}{(a+i a \tan (e+f x))^2} \, dx &=\frac{(a c) \operatorname{Subst}\left (\int \frac{(A+B x) (c-i c x)}{(a+i a x)^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{(a c) \operatorname{Subst}\left (\int \left (\frac{2 i (A+i B) c}{a^3 (-i+x)^3}+\frac{(A+3 i B) c}{a^3 (-i+x)^2}+\frac{B c}{a^3 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{i B c^2 x}{a^2}-\frac{B c^2 \log (\cos (e+f x))}{a^2 f}-\frac{(i A-B) c^2}{a^2 f (i-\tan (e+f x))^2}+\frac{(A+3 i B) c^2}{a^2 f (i-\tan (e+f x))}\\ \end{align*}
Mathematica [A] time = 2.45383, size = 140, normalized size = 1.44 \[ \frac{c^2 \sec ^2(e+f x) \left (\cos (2 (e+f x)) \left (-i A+2 B \log \left (\cos ^2(e+f x)\right )+B\right )-A \sin (2 (e+f x))-i B \sin (2 (e+f x))+2 i B \sin (2 (e+f x)) \log \left (\cos ^2(e+f x)\right )+4 B \tan ^{-1}(\tan (f x)) (\sin (2 (e+f x))-i \cos (2 (e+f x)))-4 B\right )}{4 a^2 f (\tan (e+f x)-i)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.044, size = 116, normalized size = 1.2 \begin{align*}{\frac{-3\,i{c}^{2}B}{f{a}^{2} \left ( \tan \left ( fx+e \right ) -i \right ) }}-{\frac{A{c}^{2}}{f{a}^{2} \left ( \tan \left ( fx+e \right ) -i \right ) }}+{\frac{B{c}^{2}\ln \left ( \tan \left ( fx+e \right ) -i \right ) }{f{a}^{2}}}-{\frac{iA{c}^{2}}{f{a}^{2} \left ( \tan \left ( fx+e \right ) -i \right ) ^{2}}}+{\frac{B{c}^{2}}{f{a}^{2} \left ( \tan \left ( fx+e \right ) -i \right ) ^{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: RuntimeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.10993, size = 236, normalized size = 2.43 \begin{align*} \frac{{\left (8 i \, B c^{2} f x e^{\left (4 i \, f x + 4 i \, e\right )} - 4 \, B c^{2} e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) + 4 \, B c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} +{\left (i \, A - B\right )} c^{2}\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{4 \, a^{2} f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 1.76239, size = 207, normalized size = 2.13 \begin{align*} \frac{2 i B c^{2} x}{a^{2}} - \frac{B c^{2} \log{\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a^{2} f} + \begin{cases} \frac{\left (4 B a^{2} c^{2} f e^{4 i e} e^{- 2 i f x} + \left (i A a^{2} c^{2} f e^{2 i e} - B a^{2} c^{2} f e^{2 i e}\right ) e^{- 4 i f x}\right ) e^{- 6 i e}}{4 a^{4} f^{2}} & \text{for}\: 4 a^{4} f^{2} e^{6 i e} \neq 0 \\x \left (- \frac{2 i B c^{2}}{a^{2}} + \frac{\left (A c^{2} + 2 i B c^{2} e^{4 i e} - 2 i B c^{2} e^{2 i e} + i B c^{2}\right ) e^{- 4 i e}}{a^{2}}\right ) & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.24559, size = 275, normalized size = 2.84 \begin{align*} \frac{\frac{12 \, B c^{2} \log \left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - i\right )}{a^{2}} - \frac{6 \, B c^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 1 \right |}\right )}{a^{2}} - \frac{6 \, B c^{2} \log \left ({\left | \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - 1 \right |}\right )}{a^{2}} - \frac{25 \, B c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{4} + 12 \, A c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 112 i \, B c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} - 198 \, B c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 12 \, A c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 112 i \, B c^{2} \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 25 \, B c^{2}}{a^{2}{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) - i\right )}^{4}}}{6 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]